﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TVset.Enums;

namespace TVset
{
    class TVset
    {
        public bool   SwitchOnOff { get; set; }

        #region Private fields

        int _sountVolume;
        ProducerName _brand;

        #endregion

        #region Construction

        public TVset(ProducerName brand)
        {
            SwitchOnOff = false;

            _sountVolume = 50;
            _brand       = brand;

            Console.WriteLine("There is a {0} TV set.", _brand);
        }

        #endregion
 
        public int IncreaseVolumeOfSound 
        { 
            get { return _sountVolume; } 
            set 
            { 
                _sountVolume = value;
                if (_sountVolume >= 100) { _sountVolume = 100; Console.Beep();}
            }
        }
        public int DecreaseVolumeOfSound
        {
            get { return _sountVolume; }
            set
            {
                _sountVolume = value;
                if (_sountVolume <= 0) { _sountVolume = 100; Console.Beep();}
            }
        }
        public void turnOnOffTV()
        {
            if (SwitchOnOff == false)
                SwitchOnOff = true; 
            else 
                SwitchOnOff = false;            
        } 
    }
}
